<template>
    <view>
    <!-- 分类模块开始 -->
    <view class="content_list">
        <navigator class="content_item"
        v-for="item in catlist"
        :key="item.id"
        :url="`/pages/imgfenlei/index?id=${item.id}`"
        >
            <image mode="aspectFill" :src="item.cover"></image>
            <text>{{item.name}}</text>
        </navigator>
    </view>
     <!-- 分类模块结束 -->
    </view>
</template>

<script>
export default {
    data(){
        return {
            catlist:[]
        }
    },
    mounted(){
    this.getlist()
    uni.setNavigationBarTitle({title:"分类"})
    },
    methods:{
        getlist(){
            this.request({
                url:"http://157.122.54.189:9088/image/v1/vertical/category"
            })
            .then(result=>{
                console.log(result)
                this.catlist=result.res.category
                console.log(this.catlist)
            })
        }
    }
}
</script>

<style lang="scss">
  .content_list{
      display:flex;
      flex-wrap:wrap;
      .content_item{
          position: relative;
          width:33.33%;
          border:2px solid #fff;
          height:300rpx;
          image{
              height:100%;
          }
          text{
              position:absolute;
              bottom:5rpx;
              left:5rpx;
              color:#fff;
              font-size:36rpx;
              
          }
      }
  }  
</style>